import service from '@/utils/request'
import {ApiResponse,ListApiResponse} from '@/store/dataType.ts'

export const API_CONFIG={
      // 查询参数列表
      listConfig:(query:any):Promise<ListApiResponse>=>{return service.get('/system/config/list',{params: query})},
      // 根据参数编号获取详细信息
      getConfig:(configId:string|number):Promise<ApiResponse> =>{return service.get('/system/config/' + configId)},
      // 根据参数键名查询参数值
      getConfigKey:(configKey:string):Promise<ApiResponse> => {return service.get('/system/config/configKey/' + configKey)},
      // 新增参数配置
      addConfig:(data:any):Promise<ApiResponse>  => {return service.post('/system/config',data)},
      // 修改参数配置
      updateConfig:(data:any):Promise<ApiResponse> => {return service.put('/system/config',data)},
      // 删除参数配置
      delConfig:(configId:string|number):Promise<ApiResponse> =>  {return service.delete('/system/config/' + configId)},
      // 刷新参数配置缓存
      refreshCache:():Promise<ApiResponse>=>{return service.delete('/system/config/refreshCache')}


}
